package com.getpebble.android.framework.notification.gmail;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import com.getpebble.android.common.core.trace.Trace;
import java.util.ArrayList;
import java.util.List;

public class GmailAddress {
    private static final String TAG = GmailAddress.class.getSimpleName();

    public static List<Account> getAccountsList(Context context) {
        ArrayList<Account> results = new ArrayList();
        AccountManager manager = AccountManager.get(context);
        if (manager == null) {
            Trace.warning(TAG, "manager is null");
        } else {
            for (Account account : manager.getAccountsByType("com.google")) {
                results.add(account);
            }
        }
        return results;
    }
}
